<?php
namespace modules\post\service;

use idea\saf\sl\Service;

/**
 * Modules class file
 * modules表服务类
 * @author 宋欢 <iphper@yeah.net>
 * @version $Id: Modules.php 1 2013-05-18 14:58:59Z huan.song $
 * @package modules.post.service
 * @since 1.0
 */
class Modules extends Service
{
	/**
	 * 添加一条记录
	 * @param array $params
	 * @return array
	 */
	public function add(array $params = array())
	{
		return $this->insert($params, $this->getForm()->getRules());
	}

	/**
	 * 更新一条记录
	 * @param integer $id
	 * @param array $params
	 * @return array
	 */
	public function edit($id , array $params = array())
	{
		$this->removeAttributes($params, array('module_name', 'module_tblname'));
		return $this->updateByPk($id, $params, $this->getForm()->getRules());
	}
}
